import json

import jmespath

from api.server.goods.api_goods_list import Goods


def grammar():
    return "data.data[0].goods_id"
def extract(data):
    return  jmespath.search(grammar(), data)

if __name__ == '__main__':
    goods = Goods()
    print(json.dumps(goods.goods_list(), indent=2, ensure_ascii=False))
    print(extract(goods.goods_list()))
